/*------------------------------------------------
<> SO_MANAGER class
<> 2008.07.31 - Robert Vanca
<> v0.2

Class for managing screen objects.
Features:
	- Rendering objects
	- Mouse event handling

TODO:	- Code review.
		- Handle other messages as well, do more with screen objects.

--------------------------------------------------*/
#pragma once
#ifndef _BASELIB_SCREENOBJECT_MANAGER_H
#define _BASELIB_SCREENOBJECT_MANAGER_H

using namespace std;

class SO_MANAGER
{
private:
	vector<ScreenObject*> ObjectList;
	int mousex_whendown;
	int mousey_whendown;
	int posx_whendown;
	int posy_whendown;
	bool mousedown;

public:
	SO_MANAGER();
	~SO_MANAGER(void);

	ScreenObject* GetSObject(int objref) { return ObjectList[objref-1]; }

	void NewObject();
	void NewObject(const wchar_t*);
	void Connect (ScreenObject* SO1, ScreenObject* SO2);

	void OnMouseDown(MESSAGE_HANDLER* pMessageHandler, int x, int y);
	void OnMouseUp(MESSAGE_HANDLER* pMessageHandler, int x, int y);
	void OnMouseMove(MESSAGE_HANDLER* pMessageHandler,int cur_x, int cur_y);

	void Render(BASE_RENDERER* pRenderer);
	
};

#endif //#define _BASELIB_SCREENOBJECT_MANAGER_H